Intro

Chrome extension

This Nordcraft package enables dynamic interaction with any webpage’s DOM. It can read, add, modify, and delete DOM elements, as well as inject Nordcraft components directly into the page.

Download the chrome extension & read instructions on Github first (click here)!

Demo

A few examples are provided, but many more options are available, see the arguments below for the many available options.

  • Current tabInfo

    The current URL is:

  • Remove element

    Selector
  • Set element

    Selector
    Text
  • Observe h1

    H1 Value is currently:

  • Inject Nordcraft Component

    Selector

Components

  • chrome_extension

    Unstyled Nordcraft component containing the core logic for the Chrome extension. Simply add the component to your page to access all functionalities.

    Events

    TabinfoChangedEvent tabInfoChanged provides information about the currently viewed website and triggers when the sidebar is loaded for the first time.
  • chrome_observer

    Use this component to observe an HTML element for changes in text, value, or other properties. Add it to your page with the correct attribute to instantly know what’s happening.

    Events

    valueChangedProvides information about the current selector and triggers when the observer first loads or when the current value changes.

    Context

    ReloadWorkflow that reload the observer, for example on new pageload.

    Attributes

    selectorSpecify the DOM selector of the HTML element to observe.
    attributeChoose the attribute to observe; defaults to innerText.
    event-typeChoose the event type to observe; defaults to DOMSubtreeModified.

Actions

  • InjectComponent

    Allows injecting Nordcraft components directly into the DOM.

    Arguments

    nameUse the component name exactly as defined in the export-as-web-component functionality (toddle-componentName)
    srcUse the script src value exactly as defined in the export-as-web-component functionality.
    selectorSpecify the DOM selector that defines the injection point for the component.
    placementDefine the placement method: replace, append, or prepend, to control how the component is injected into the target element.
  • manipulateDom

    Allows modifying the DOM.

    Arguments

    selectorSpecify the DOM selector that defines the injection point for the component.
    actionSpecify the action to perform: setText, setHTML, setStyle, addClass, removeClass, toggleClass, appendHTML, prependHTML, click, setInputValue.
    newValueSpecify the new value to be injected into the DOM.